var echart1; //, echart2;
// Step:3 为模块加载器配置echarts的路径，从当前页面链接到echarts.js，定义所需图表路径
//var fileLocation = 'js/echarts/echarts';
     require.config({
         paths: {
         echarts: 'js/echarts'
    }
});
	  	  
// Step:4 动态加载echarts然后在回调函数中开始使用，注意保持按需加载结构定义图表路径
require(
    [
        'echarts',
        'echarts/chart/bar',
    ],
    requireCallbackWebData
    );
	        

function requireCallbackWebData(ec) {
	
	echarts = ec;
	var myChart = ec.init(document.getElementById('main4'));
	var ecConfig = require('echarts/config');

//*************************** option start



    function random(){
        var r = Math.round(Math.random() * 20);
        return (r * (r % 2 == 0 ? 1 : -1));
    }

    function randomDataArray() {
        var d = [];
        var len = 6;
        while (len--) {
            d.push([
                random(),
                random(),
                Math.abs(random()),
            ]);
        }
        return d;
    }

    option = {
        tooltip : {
            trigger: 'axis',
            showDelay : 0,
            axisPointer:{
                show: true,
                type : 'cross',
                lineStyle: {
                    type : 'dashed',
                    width : 1
                }
            }
        },
        legend: {
            data:['scatter1','scatter2','scatter3','scatter4','scatter5']
        },
        toolbox: {
            show : false,
            feature : {
                mark : {show: false},
                dataZoom : {show: false},
                dataView : {show: false, readOnly: false},
                restore : {show: true},
                saveAsImage : {show: true}
            }
        },
        xAxis : [
            {
                type : 'value',
                splitNumber: 2,
                scale: false
            }
        ],
        yAxis : [
            {
                type : 'value',
                splitNumber: 2,
                scale: false
            }
        ],
        series : [
            {
                name:'scatter1',
                type:'scatter',
                symbolSize:50,
                data:[0,0,50]
            },
            {
                name:'scatter2',
                type:'scatter',
                symbolSize: 30,
                data: [110,120,30]
            },
            {
                name:'scatter3',
                type:'scatter',
                symbolSize:30,
                data: [-130,-100,30]
            },
            {
                name:'scatter4',
                type:'scatter',
                symbolSize: 30,
                data: [140,-100,30]
            },
            {
                name:'scatter5',
                type:'scatter',
                symbolSize: 10,
                data: [-100,100,30]
            }
        ]
    };







//*************************** option end

myChart.setOption(option);




};


